<!DOCTYPE html>
<html>
<head>
    <title>添加优惠卷</title>
    <link rel="stylesheet" href="http://cdn.bootcss.com/twitter-bootstrap/2.0.4/css/bootstrap.min.css">
    <style type="text/css">
        body {
            margin: 20 auto 0 auto;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="row">
        <form action="/admin_1427a/coupon/save" method="POST" enctype="multipart/form-data" class="form-horizontal">
            <fieldset>
                <div id="legend" class="">
                    <legend class="">优惠卷编辑</legend>
                </div>

                <div class="control-group">
                    <label class="control-label" for="input01">优惠卷名称</label>
                    <div class="controls">
                        <input type="text" name="name" placeholder="优惠卷名称" class="input-xlarge"
                               value="{{ $coupon ? $coupon->name : '' }}">
                    </div>
                </div>

                {{--<div class="control-group">--}}
                    {{--<label class="control-label" for="input01">最小使用金额</label>--}}
                    {{--<div class="controls">--}}
                        {{--<input type="text" name="min_price" placeholder="最小使用金额" class="input-xlarge"--}}
                               {{--value="{{ $coupon ? $coupon->min_price : '' }}">--}}
                    {{--</div>--}}
                {{--</div>--}}

                <div class="control-group">
                    <label class="control-label" for="input01">优惠劵金额</label>
                    <div class="controls">
                        <input type="text" name="max_value" placeholder="优惠劵金额" class="input-xlarge"
                               value="{{ $coupon ? $coupon->max_value : '' }}">
                    </div>
                </div>

                <div class="control-group">

                    <label class="control-label">使用范围类型</label>
                    <div class="controls">
                        <label class="radio">
                            <input type="radio" value="1" name="scope_type"
                                   <?php if( $coupon && $coupon->scope_type == 1) {?> checked="checked" <?php } ?>>满减
                        </label>
                        <label class="radio">
                            <input type="radio" value="2" name="scope_type"
                                   <?php if($coupon && $coupon->scope_type == 2) {?> checked="checked" <?php } ?>>赠送商品
                        </label>
                        <label class="radio">
                            <input type="radio" value="3" name="scope_type"
                                   <?php if($coupon && $coupon->scope_type == 3) {?> checked="checked" <?php } ?>>赠送小妖币
                        </label>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="input01">商品ID</label>
                    <div class="controls">
                        <input type="text" name="goods_id" placeholder="赠送类型才填写商品ID" class="input-xlarge"
                               value="{{ $coupon ? $coupon->goods_id : '' }}">
                    </div>
                </div>

                <div class="control-group">
                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                    <input type="hidden" name="id" value="{{ $coupon ? $coupon->id : 0 }}">
                    <label class="control-label"></label>
                    <div class="controls">
                        <button type="submit" class="btn btn-default">提交</button>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
</div>
</body>
</html>
